{
struct hiddev_usage_ref_multi urefm;
struct hiddev_report_info rinfo;
- const gbuint8* p = buf;
+ const gbuint8* p = (const gbuint8*) buf;
unsigned i;
for (i = 0; i < size; i++) {
void wpt_name(const char* args, const char** unused)
{
- char* s;
+ const char* s;
if (!args) {
return;
}
waypt_alloc_gc_data(wpt_tmp)->placer = xstrdup(s + 4);
if (nuke_placer) {
- *s = '\0';
+ // Sleaze alert. We're casting away constness and writing into a string
+ // that should probably be read-only...
+ *(char *)s = '\0';
}
}
}
void wpt_container(const char* args, const char** unused)
{
- int v;
+ geocache_container v;
if (!args) {
return;
{
char buff[32];
char* ck;
- char* filename;
+ const char* filename;
CHECK_BOOL(optclean);
if (optminspeed) {
minspeed=atof(optminspeed);
static void getAttr(const char* data, const char* attr, char** val, char seperator)
{
- char* start;
+ const char* start;
if ((start = strstr(data, attr)) != NULL) {
- char* end;
+ const char* end;
int len;
end = strchr(start, seperator);
#if !HAVE_LIBUSB
const char no_usb[] = "USB support is not available in this build.\n";
-
+typedef struct gpsdevh gpsdevh;
int
-gusb_init(const char* portname)
+gusb_init(const char* portname, gpsdevh** dh)
{
fatal(no_usb);
return 0;
int nremains = strlen(esc);
if (nremains >= 3) {
static const char hex[17] = "0123456789ABCDEF";
- char* c1 = strchr(hex, esc[1]);
- char* c2 = strchr(hex, esc[2]);
+ const char* c1 = strchr(hex, esc[1]);
+ const char* c2 = strchr(hex, esc[2]);
if (c1 && c2) {
int escv = (c1 - hex) * 16 + (c2 - hex);
if (escv == 255) { /* corrupted data */
static void
mag_rd_init_common(const char* portname)
{
- char* ext;
+ const char* ext;
waypoint_read_count = 0;
// For Explorist GC, intercept the device access and redirect to GPX.
// We actually do the rd_init() inside read as we may have multiple
ozi_set_time_str(const char *str, waypoint *waypointp)
{
double ozi_time;
- char *dot;
+ const char *dot;
int len;
ozi_time = atof(str);
*/
static
-char *ppdb_strcat(char *dest, char *src, char *def, int *size)
+char *ppdb_strcat(char *dest, const char *src, char *def, int *size)
{
int len;
- char *res, *tmp;
+ char *res;
+ const char *tmp;
tmp = src;
if (tmp == NULL) {
CHECK_INP(1, sscanf(str,"%lf", &val), "decode_coord(1) DD.dddd", str);
return val;
} else {
- char *tmp;
+ const char *tmp;
if (*str == 'O') {
german_release = 1;
{
const char *Digits = "0123456789ABCDEF";
const char *digits = "0123456789abcdef";
- char * ofs = strchr(digits, hex);
+ const char *ofs = strchr(digits, hex);
if (ofs) {
return ofs-digits;
}
static char *
fix_notes(const char *name, char *notes)
{
- char *cleft, *cright, *cback, *ctmp;
+ const char *cleft, *cright, *cback;
+ char *ctmp;
if ((! name) || (! notes)) {
return notes;
return;
}
+ // FIXME: this code should really not be writing into the arg list.
while (*avp) {
if (strcmp(avp[0], "y") == 0) {
- comma = strstr(avp[1], ",");
+ char *tbuf = xstrdup(avp[0]);
+ comma = strstr(tbuf, ",");
if (comma) {
*comma='.';
}
- sscanf(avp[1], "%lf", &wpt_tmp->latitude);
+ sscanf(tbuf, "%lf", &wpt_tmp->latitude);
+ xfree(tbuf);
} else if (strcmp(avp[0], "x") == 0) {
- comma = strstr(avp[1], ",");
+ char *tbuf = xstrdup(avp[1]);
+ comma = strstr(tbuf, ",");
if (comma) {
*comma='.';
}
- sscanf(avp[1], "%lf", &wpt_tmp->longitude);
+ sscanf(tbuf, "%lf", &wpt_tmp->longitude);
+ xfree(tbuf);
}
avp+=2;
}
}
static void
-xcsv_parse_style_line(const char *sbuff)
+xcsv_parse_style_line(char *sbuff)
{
int i, linecount = 0;
- char *s, *p, *sp;
+ char *s, *sp;
+ char *p;
const char *cp;
char *key, *val, *pfc;